//
//  AFNTool.h
//  Sneaker
//
//  Created by YouLu on 15/6/29.
//  Copyright (c) 2015年 lijiangang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"
typedef NS_ENUM(NSInteger, HTTPStyle){
    HTTP,
    JSON,
    XML
};
typedef NS_ENUM(NSInteger, RequsetBodyStyle){
    StringBody,
    JSONBody
};
@interface AFNTool : NSObject
/**
 *  网络请求get
 *
 *  @param url     请求url
 *  @param body    网络请求携带的Body
 *  @param style   请求返回的数据的格式
 *  @param success 成功调用的Block
 *  @param failure 失败调用的Block
 */
+(void)get:(NSString *)url Body:(id)body HttpResult:(HTTPStyle)style success:(void(^)(id result))success failure:(void(^)(NSError *error))failure;
+(void)post:(NSString *)url Body:(id)body HttpResult:(HTTPStyle)style RequsetBodyStyle:(RequsetBodyStyle)bodyStyle httpHead:(NSDictionary *)dic success:(void(^)(id result))success failure:(void(^)(NSError *error))failure;
@end
